package com.lantosec.hmrp.modules.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.system.vo.SysWorkdayVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

/**
 * <p>
 * 系统工作日管理 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-03-24
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysWorkday extends BaseEntity<SysWorkdayVO> {

    private static final long serialVersionUID = 1L;
    public SysWorkday(SysWorkdayVO vo){
        this.workdayDate = vo.getWorkdayDate();
        this.workdayYaer = vo.getWorkdayYaer();
        this.workdayMonth = vo.getWorkdayMonth();
        this.workdayDay = vo.getWorkdayDay();
        this.workdayWeek = vo.getWorkdayWeek();
        this.workdayType = vo.getWorkdayType();
        this.flag = vo.getFlag();
    }

    @Override
    public SysWorkdayVO convertToVO(){
        return new SysWorkdayVO(this);
    }


    /**
     * 日期(yyyy-MM-dd)
     */
    @TableId(value = "workday_date", type = IdType.ASSIGN_UUID)
    private String workdayDate;

    /**
     * 年
     */
    private String workdayYaer;

    /**
     * 月
     */
    private String workdayMonth;

    /**
     * 日
     */
    private String workdayDay;

    /**
     * 周
     */
    private Integer workdayWeek;

    /**
     * 工作日类型(0工作日1正常休息2国定节假日)
     */
    private Integer workdayType;

    @TableField(exist = false)
    private Integer flag;


    public enum ColName {
        workday_date, workday_yaer, workday_month, workday_day, workday_week, workday_type,
    }
}
